package com.itheima.demo;

public class DuotaiDemo {
    public static void main(String[] args) {
        new Wife().listen(new Parrot());
    }
}

class Bird{
    private String wing;
    public void moo(){
        System.out.println("鸟叫声");
    }
}

class Parrot extends Bird{
    public void moo(){
        System.out.println("鹦鹉的叫声");
    }
}

class Sparrow extends Bird{
    public void moo(){
        System.out.println("麻雀的叫声");
    }
}

class Wife {
    public void listen(Bird bird) {
        bird.moo();
    }
}